1. Field of the Disclosure
The present disclosure is generally directed to prefetching data and, more particularly, to prefetching data from a memory based on a stride pattern.
2. Description of the Related Art
Prefetch engines have been employed within processor systems to detect patterns in addresses associated with reads of main memory. The detected patterns have been utilized by the prefetch engines to predict future addresses in the main memory from which data will be read. The data from the predicted future addresses of the main memory has then been prefetched from the main memory to a cache memory (cache) prior to an actual request for the data. When the data is requested, the prefetched data may be consumed by an associated operation executing on a central processing unit (CPU) or may be consumed by an input/output (I/O) device, without the delay usually associated with reading the data from the main memory. In a typical processor system, multiple prefetch engines may be employed to independently track respective independent address streams.
Traditionally, many processor systems have employed a shared structure (to reduce the amount of resources required for storing stride patterns) that has maintained a linked list of strides for multiple prefetch engines. For example, for the stride pattern +1, +2, +1, +2, . . . , a first prefetch engine may build the following linked list: +1−>+2; and +2−>+1. In this case, a +2 stride follows a +1 stride and a +1 stride follows a +2 stride. Unfortunately, when multiple prefetch engines are utilizing the same shared structure to store stride patterns, each of the prefetch engines may attempt to modify the linked list to match the stride pattern of an associated address stream. For example, for the stride pattern +1, +3, +1, +3, . . . , a second prefetch engine may build the following linked list: +1−>+3; and +3−>+1. In this case, a +3 stride follows a +1 stride and a +1 stride follows a +3 stride. In this example, the strides conflict between the first and second prefetch engines and, as such, the prefetch engines may prefetch data from an incorrect address.
What is needed is an improved technique for prefetching data from a memory based on a detected stride pattern.
The use of the same reference symbols in different drawings indicates similar or identical items.